def call(Map config) {
            projectpom = readMavenPom file: 'pom.xml'
            env.projectArtifactId = projectpom.getArtifactId()
            env.Artifact_ID  = "${projectArtifactId}"
            env.K8S_persistence_enabled  = "${config.k8s.persistence.enabled}"
            env.K8S_persistence_subpath = "${config.k8s.persistence.subpath}"
            env.K8S_health_path = "${config.k8s.health_path}"
            env.K8S_env_appParams = "${config.k8s.env.namespace_DEV.appParams}"
            env.K8S_env_javaParams = "${config.k8s.env.namespace_DEV.javaParams}"
            env.K8S_SIT_appParams = "${config.k8s.env.namespace_SIT.appParams}"
            env.K8S_SIT_javaParams = "${config.k8s.env.namespace_SIT.javaParams}"
            env.K8S_UAT_appParams = "${config.k8s.env.namespace_UAT.appParams}"
            env.K8S_UAT_javaParams = "${config.k8s.env.namespace_UAT.javaParams}"
            env.K8S_BUG_appParams = "${config.k8s.env.namespace_BUG.appParams}"
            env.K8S_BUG_javaParams = "${config.k8s.env.namespace_BUG.javaParams}"
            env.K8S_DEMO_appParams = "${config.k8s.env.namespace_DEMO.appParams}"
            env.K8S_DEMO_javaParams = "${config.k8s.env.namespace_DEMO.javaParams}"
            env.K8S_jvmCacerts_enabled = "${config.k8s.jvmCacerts.enabled}"

            container('maven') {
                scmUtils.checkoutFormGit('./k8sconfig','git@gitee.com:klxedu/k8sconfig-java.git','master',config.scmCredentialsId)
                //checkFromGit('./k8sconfig','git@gitee.com:klxedu/k8sconfig-java.git','master')
                dir ('./k8sconfig') {
                    script{
                        if("${config.k8s.health_path}" == null || "${config.k8s.health_path}"=="null"){
                            env.K8S_health_path="actuator/health"
                        }
                        //如果集成测试环境未定义使用开发环境参数
                        if("${K8S_SIT_appParams}" == null || "${K8S_SIT_appParams}"=="null"){
                            env.K8S_SIT_appParams="${config.k8s.env.namespace_DEV.appParams}"
                        }
                        //如果集成测试环境未定义使用开发环境参数
                        if("${K8S_SIT_javaParams}" == null || "${K8S_SIT_javaParams}"=="null"){
                            env.K8S_SIT_javaParams="${config.k8s.env.namespace_DEV.javaParams}"
                        }
                        //如果演示环境未定义使用开发环境参数
                        if("${K8S_UAT_appParams}" == null || "${K8S_UAT_appParams}"=="null"){
                            env.K8S_UAT_appParams="${config.k8s.env.namespace_DEV.appParams}"
                        }
                        //如果演示环境未定义使用开发环境参数
                        if("${K8S_UAT_javaParams}" == null || "${K8S_UAT_javaParams}"=="null"){
                            env.K8S_UAT_javaParams="${config.k8s.env.namespace_DEV.javaParams}"
                        }
                        //如果BUG环境未定义使用开发环境参数
                        if("${K8S_BUG_appParams}" == null || "${K8S_BUG_appParams}"=="null"){
                            env.K8S_BUG_appParams="${config.k8s.env.namespace_BUG.appParams}"
                        }
                        //如果BUG环境未定义使用开发环境参数
                        if("${K8S_BUG_javaParams}" == null || "${K8S_BUG_javaParams}"=="null"){
                            env.K8S_BUG_javaParams="${config.k8s.env.namespace_BUG.javaParams}"
                        }
                        //如果demo环境未定义使用开发环境参数
                        if("${K8S_DEMO_appParams}" == null || "${K8S_DEMO_appParams}"=="null"){
                            env.K8S_DEMO_appParams="${config.k8s.env.namespace_DEMO.appParams}"
                        }
                        //如果demo环境未定义使用开发环境参数
                        if("${K8S_DEMO_javaParams}" == null || "${K8S_DEMO_javaParams}"=="null"){
                            env.K8S_DEMO_javaParams="${config.k8s.env.namespace_DEMO.javaParams}"
                        }
                        //如果未配置jvmCacerts，将关闭相关配置
                        if("${K8S_jvmCacerts_enabled}" == null || "${K8S_jvmCacerts_enabled}"=="null"){
                            env.K8S_jvmCacerts_enabled="false"
                        }

                        //如果未配置project.code，将使用默认值goldgov
                        if("${config.project.code}" == null || "${config.project.code}"=="null"){
                            env.PROJECT_NAME="goldgov"
                        }
                        //sh "ls charts -ls"
                        sh "mv charts/ARTIFACT_ID charts/${projectArtifactId}"
                        //sh "export Artifact_ID=${projectArtifactId} && export K8S_persistence_enabled=${config.k8s.persistence.enabled} && export K8S_env_appParams=${config.K8S_env_appParams} && export K8S_env_javaParams=${K8S_env_javaParams} && make replace"
                        sh "make replace"
                    }
                }
            }
}
